//
//  GEProductsViewController.m
//  GPurchase
//
//  Created by limei.li on 2017/5/10.
//  Copyright © 2017年 gta Education. All rights reserved.
//

#import "GEProductsViewController.h"

@interface GEProductsViewController ()

@end

@implementation GEProductsViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    [self  setupNavigationItems];
}
    
- (void)setupNavigationItems
    {
        
        
        //搜索按钮
        UIImage *searchImg = [[UIImage imageNamed:@"search"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        UIButton *searchButton = [[UIButton alloc]init];
        searchButton.userInteractionEnabled = YES;
        [searchButton setImage:searchImg forState:UIControlStateNormal];
        [searchButton setImage:searchImg forState:UIControlStateSelected];
        [searchButton sizeToFit];
        [searchButton addTarget:self action:@selector(searchButtonDidClicked) forControlEvents:UIControlEventTouchUpInside];
        UIBarButtonItem *searchItem = [[UIBarButtonItem alloc]initWithCustomView:searchButton];
        
        self.navigationItem.leftBarButtonItem = searchItem;
        
        
        //消息按钮
        UIImage *massageImg = [[UIImage imageNamed:@"message"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
        UIButton *massageButton = [[UIButton alloc]init];
        massageButton.userInteractionEnabled = YES;
        [massageButton setImage:massageImg forState:UIControlStateNormal];
        [massageButton setImage:massageImg forState:UIControlStateSelected];
        [massageButton sizeToFit];
        [massageButton addTarget:self action:@selector(messageButtonDidClicked) forControlEvents:UIControlEventTouchUpInside];
        UIBarButtonItem *massageItem = [[UIBarButtonItem alloc]initWithCustomView:massageButton];
        
        self.navigationItem.rightBarButtonItem = massageItem;
    }
    
    /**
     *  搜索按钮点击事件
     */
- (void)searchButtonDidClicked{
    NSLog(@"sfdddddddd");
    
}
    
    /**
     *  消息按钮点击事件
     */
- (void)messageButtonDidClicked{
    
    
}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
